<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/7/30 下午3:42
 * +-------------------------------------------------------------
 */

namespace app\common\service\easysms;

use Overtrue\EasySms\Strategies\OrderStrategy;

class EasySmsConfig
{
    public static function getConfig($smsConfig): array
    {
        return [
            // HTTP 请求的超时时间（秒）
            'timeout'  => 5.0,

            // 默认发送配置
            'default'  => [
                // 网关调用策略，默认：顺序调用
                'strategy' => OrderStrategy::class,

                // 默认可用的发送网关
                'gateways' => [$smsConfig['sms_type']],
            ],
            // 可用的网关配置
            'gateways' => [
                    'aliyun' => [
                            'access_key_id'     => $smsConfig['alsms_access_key_id'],
                            'access_key_secret' => $smsConfig['alsms_access_key_secret'],
                            'sign_name'         => $smsConfig['alsms_sign_name'],
                    ],
                    // 可以添加更多服务商配置...
            ]
        ];
    }
}